Object-oriented programs (OOPs) have been regarded to be on the merits over typical procedural programs, which include code reuses from succession, the accomplishment of data abstraction, the factuality of poly-configuration for data, the facilities of overloading operators. Those prolific performances of the OOPs are being more advanced continuously. Meanwhile, from a growing number of studies, a dynamic memory management (DMM) is now considered as a significant component in operation of a software system, consuming up 30% of the program execution time therein. Therefore, the importance for the dynamic memory management becomes heavier and the higher efficiency of conducting the DMM needs to improve a program operation speed in the system.
It has been usual to carry out a DMM in the way of memory allocation regardless of object sizes, as shown in FIGS. 1 and 2. Referring to FIG. 1, if there is a request for memory by way of an operation system (OS) in a step S103, e.g. an invocation of a function sbrk( ) by a memory management (or allocation) function malloc( ), the memory is assigned to a heap. Then, in step S105, a free link list is generated by a memory management unit to allocate objects to the memory that is segmented into partitions in adequate sizes (refer to process A of FIG. 2).
If there is a request for object allocation, it scans the free link list at step S107 to find a node having the same size with the object requested for allocation. In step S109, it determines there is the node of the same size of the requested object. If the free link list has the node with the same size of the requested object, the node is released from the free link list and then put into the object allocation process in step S111. On the other hand, if there is no one accordant with the requested object in size in the free link list, it determines whether the size of the requested object is larger than nodes of the free link list at step S13. If the requested object is larger than the nodes of the free link list, the nodes of the free link list are coalesced into a single node at step S15 (refer to process B of FIG. 2) and the coalesced node is released from the free link list to be used in allocating the object at step S117. To the contrary, if the requested object is smaller than the nodes of the free link list, the nodes are split into smaller nodes in step S119 (refer to process C of FIG. 2) and the split nodes are released from the free link list to be used in allocating the object at step S121.
By the way, if an allocated object is deleted, a node allocated to the object is inserted into the free link list for reuse. While this, too large node to be inserted into the free link list may be split into further smaller node adequate to be inserted thereinto.
However, the conventional manner of DMM consumes up a considerable execution time in operation because it basically needs terms of scanning the free link list, and coalescing and splitting the nodes composing the free link list. Sometimes, it would occur with the worst case that the free link list should be quested in full.
Moreover, the function malloc( ) is forced to be invoked, as well as conducting the scanning for the free link list and the coalescing and splitting of the nodes, whenever there is a request for the object allocation.